//
//  BodayFileViewMode.m
//  fitness-iOS
//
//  Created by 卢仕彤 on 2017/12/16.
//  Copyright © 2017年 卢仕彤. All rights reserved.
//

#import "BodayFileViewMode.h"
#import "UIColor+Expand.h"

@implementation BodayFileViewMode

@end

@interface BodayFileHeadCell ()
@property (nonatomic, strong) UILabel *leftLabel;
@end

@implementation BodayFileHeadCell

#pragma mark lazyinit

- (UILabel *) leftLabel{
    if (!_leftLabel) {
        _leftLabel = [UILabel labelWithSystemFontSize:12 textColorHexString:@"#333333"];
    }
    return _leftLabel;
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self initView];
    }
    return self;
}

- (void)initView {
    [self.contentView addSubview:self.leftLabel];
    self.leftLabel.text = @"身体数据";
    [self.leftLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView.left);
        make.centerY.equalTo(self.contentView.centerY);
    }];
}

@end

@interface BodayFileInfoCell ()
@property (nonatomic, strong) UIImageView *leftPicImageView;
@property (nonatomic, strong) UIImageView *rightArrowImage;
@property (nonatomic, strong) UILabel *leftLabel;
@property (nonatomic, strong) UILabel *rightLabel;

@end

@implementation BodayFileInfoCell

- (UIImageView *)rightArrowImage {
    if (!_rightArrowImage) {
        _rightArrowImage = [UIImageView new];
    }
    return _rightArrowImage;
}

- (UIImageView *)leftPicImageView {
    if (!_leftPicImageView) {
        _leftPicImageView = [UIImageView new];
    }
    return _leftPicImageView;
}

- (UILabel *) leftLabel{
    if (!_leftLabel) {
        _leftLabel = [UILabel labelWithSystemFontSize:14 textColorHexString:@"#333333"];
        
    }
    return _leftLabel;
}

- (UILabel *)rightLabel {
    if (!_rightLabel) {
        _rightLabel = [UILabel labelWithSystemFontSize:16 textColorHexString:@"#333333"];
        _rightLabel.font = [UIFont boldSystemFontOfSize:16];
    }
    return _rightLabel;
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self initView];
    }
    return self;
}

- (void)initView {
    [self.contentView addSubview:self.leftPicImageView];
    self.leftPicImageView.backgroundColor = [UIColor redColor];
    [self.leftPicImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView.left).offset(8);
        make.size.equalTo(CGSizeMake(20, 20));
        make.centerY.equalTo(self.contentView.centerY);
    }];
    
    [self.contentView addSubview:self.leftLabel];
    self.leftLabel.text = @"路石头";
    [self.leftLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.leftPicImageView.right).offset(10);
        make.centerY.equalTo(self.contentView.centerY);
    }];
    
    [self.contentView addSubview:self.rightArrowImage];
    self.rightArrowImage.image = [UIImage imageNamed:@"righr_arrow"];
    [self.rightArrowImage mas_makeConstraints:^(MASConstraintMaker *make) {
        make.size.equalTo(CGSizeMake(7, 13));
        make.centerY.equalTo(self.contentView.centerY);
        make.right.equalTo(self.right).offset(-20);
    }];
    
    [self.contentView addSubview:self.rightLabel];
    [self.rightLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.contentView.centerY);
        make.right.equalTo(self.rightArrowImage.left).offset(-8);
    }];
    
    UIView *lineView = [UIView new];
    [self.contentView addSubview:lineView];
    lineView.backgroundColor = [UIColor colorWithHexString:@"#666666"];
    [lineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView.left);
        make.right.equalTo(self.contentView.right);
        make.bottom.equalTo(self.contentView.bottom);
        make.height.equalTo(@(1));
    }];
}
@end
